Skip to content

Items API - #117

Merged
osipxd merged 11 commits into
developfrom
feature/items-api
Nov 16, 2026
Merged

osipxd merged 11 commits into
developfrom
feature/items-api

Conversation

@osipxd

@osipxd osipxd commented Nov 16, 2026

Copy link
Copy Markdown
Member
  • New ItemProvider and Items APIs with Mimic.items and Mimic.registerItemProvider(): Key IDs with a required namespace, creation for a player, String payload
  • An item belongs to the highest-priority provider recognizing it, so a custom item no longer matches its vanilla base
  • Built-in providers: minecraft, mmoitems (<type>/<id>), craftengine, customitems
  • ItemsRegistry API is deprecated: registries are bridged to providers, Mimic.itemsRegistry is a view over the new aggregator keeping IDs without namespace, ns:a:b and bare MMOItems IDs
  • ItemProvider.hasItem and BlockProvider.hasBlock let a provider check existence without listing everything
  • The HOCON payload (ItemMetaPayload) of minecraft items is deprecated in favor of item components
  • /mimic items uses the new API, disabled-items-registries is renamed to disabled-item-providers with migration

Closes #95, closes #85, closes #86, closes #87

🤖 Generated with Claude Code

Mimic asks the provider whether a block exists instead of looking for
the ID in allBlocks. By default, it still looks there, but a provider
may override it with a faster check, or if it can't list its blocks.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
@osipxd osipxd added this to the 0.11 milestone Nov 16, 2026
@osipxd osipxd mentioned this pull request Nov 16, 2026
@codacy-production

codacy-production Bot commented Nov 16, 2026 •

Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

🟢 Metrics 159 complexity · 4 duplication

Metric Results
Complexity 159
Duplication 4

View in Codacy

NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.

@osipxd
osipxd force-pushed the feature/items-api branch 2 times, most recently from 5c27240 to 3fd7fe0 Compare November 16, 2026 10:22
osipxd and others added 10 commits November 16, 2026 11:34
Mimic passes a blank state to block providers as null,
so providers don't have to handle it.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
ItemProvider is implemented by plugins to expose their items,
Items is the consumer API combining items of all providers.
Item IDs are Keys with the provider ID as a required namespace.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
MimicItems combines items of all item providers, using provider IDs
as namespaces. An item belongs to the provider with the highest priority
recognizing it. Mimic.registerItemProvider and Mimic.items give access to it.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Providers for vanilla items, MMOItems, CraftEngine and CustomItems.
MMOItems IDs include the item type: mmoitems:sword/excalibur (#87).
MMOItems and CraftEngine build an item for the given player.
Empty stacks have no ID, and air is not an item.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Item IDs require a namespace, items are created for the target player.
ID suggestions no longer search the 'mimic' namespace over all namespaces.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
ItemsRegistry, BukkitItemsRegistry, the built-in items registries and
the items registry methods of Mimic are deprecated in favor of Items API,
but keep working. ItemMetaPayload is deprecated in favor of item components.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Every registered ItemsRegistry is available via Items API as an item
provider, an ItemProvider with the same ID always replaces the bridge.
Mimic.itemsRegistry is a view over Items: it keeps the search without
a namespace, IDs with more than one ':' and MMOItems IDs without item
type, but compares items by their owner (#86).
Items registries' own isSameItem is used again (#85).

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
The option lists plugins whose items should not be available via Mimic,
including bridged items registries.
The legacy disabled-items-registries value is moved automatically.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
@osipxd
osipxd merged commit ea3d195 into develop Nov 16, 2026
3 checks passed
@osipxd
osipxd deleted the feature/items-api branch November 16, 2026 10:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant